﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PersonalWebsite.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class init : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterDatabase()
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "WS_Ability",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false, comment: "能力名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Percent = table.Column<string>(type: "longtext", nullable: true, defaultValue: "0", comment: "能力百分比")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    DeleteTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "删除时间"),
                    IsDeleted = table.Column<int>(type: "int", nullable: false, defaultValue: 0, comment: "删除标识"),
                    DeletorId = table.Column<int>(type: "int", nullable: true, comment: "删除人"),
                    CreatorId = table.Column<int>(type: "int", nullable: false, comment: "创建人"),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, defaultValue: new DateTime(2025, 3, 12, 17, 5, 44, 280, DateTimeKind.Local).AddTicks(7522), comment: "创建时间"),
                    EditorId = table.Column<int>(type: "int", nullable: true, comment: "编辑人"),
                    EditorTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "编辑时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WS_Ability", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateIndex(
                name: "IX_WS_Ability_Name",
                table: "WS_Ability",
                column: "Name",
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "WS_Ability");
        }
    }
}
